<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.2/min/dropzone.min.css">
    <link rel="stylesheet" href="../css/index.css">
    <link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css"/>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: #f4f4f4;
        }

        .header {
            background: #333;
            color: #fff;
            padding: 10px 20px;
            height: 50px;
            font-size: 24px;
        }

        table {
            width: 95%;
            margin: 20px auto;
            border-collapse: collapse;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        th, td {
            border: 1px solid #ddd;
            padding: 15px;
            text-align: left;
        }

        th {
            background-color: #6E6E6E; /* 更改为灰色 */
            color: white;
        }

        tbody tr:nth-child(even) {
            background-color: #f2f2f2;
        }

        .quantity-input {
            width: 80px;
            padding: 5px;
            text-align: center;
        }

        .submit-button {
            position: fixed;
            bottom: 60px;
            right: 20px;
            padding: 10px 20px;
            cursor: pointer;
            background-color: #6E6E6E;
            color: white;
            border: none;
            border-radius: 5px;
            font-size: 16px;
        }

        /* Map styles */
        html, body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        }

        #map-container {
            position: relative;
            width: 100%;
            height: 100%; /* Adjust height for header and footer */
            margin: 0;
            padding: 0;
        }

        #map {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        }

        .demo-title {
            position: absolute;
            top: 20px;
            left: 250px; /* Adjusted to the right of the sidebar */
            z-index: 1;
        }

        h1 {
            margin: 0;
            color: #ACB3BB;
        }

        h3 {
            font-weight: normal;
            margin-top: 5px;
            color: #8E939D;
        }

        .footer {
            position: relative;
            width: 100%;
            bottom: 0;
            text-align: center;
            background-color: #333;
            color: #fff;
            padding: 10px 0;
        }

        .footer__copyright {
            font-weight: bold;
        }

        .footer__signature {
            color: #fff;
            text-decoration: none;
        }

        .footer__icon {
            color: red;
        }
    </style>
    <title>Document</title>
</head>
<body>
<div class="grid">
    <aside class="sidenav">
        <div class="sidenav__brand">
            <i class="fas fa-feather-alt sidenav__brand-icon"></i>
            <a class="sidenav__brand-link" href="#">物资调配<span class="text-light">管理系统</span></a>
            <i class="fas fa-times sidenav__brand-close"></i>
        </div>
        <div class="sidenav__profile">
            <div class="sidenav__profile-avatar"></div>
            <div class="sidenav__profile-title text-light">用户</div>
        </div>
        <div class="row row--align-v-center row--align-h-center">
            <ul class="navList">
                <li class="navList__heading">功能列表<i class="far fa-file-alt"></i></li>
                <li>
                  <div class="navList__subheading row row--align-v-center" id="index">
                    
                    <span class="navList__subheading-title">首页</span>
                  </div>
                  
                </li>  
                <li id="managementLi">
                  <div class="navList__subheading row row--align-v-center" id="management">
                    
                    <span class="navList__subheading-title">物资调配数据管理</span>
                  </div>
                  
                </li>
                <li id="warehouseLi">
                  <div class="navList__subheading row row--align-v-center" id="warehouse">
                    
                    <span class="navList__subheading-title">仓库数据管理</span>
                  </div>
                  
                </li>
                <li id="submitLi">
                  <div class="navList__subheading row row--align-v-center" id="submit">
                    
                    <span class="navList__subheading-title">物资调配请求上传</span>
                  </div>
                </li>
                <li id="statisticsLi">
                  <div class="navList__subheading row row--align-v-center" id="province">
                    
                    <span class="navList__subheading-title">省份物资统计</span>
                  </div>
                  
                </li>
              </ul>
        </div>
    </aside>
    <main class="main">
      
        <div class="main-overview">
          <div id="container">
            <div class="demo-title">
                <h1>中国各省市仓储量情况</h1>
                <h3>Warehousing volume in various cities across the country</h3>
            </div>
            <div id="map-container">
                <div id="map"></div>
            </div>
           </div>
        </div> <!-- /.main__overview -->
      </main>
    

    <footer class="footer">
        <p><span class="footer__copyright">&copy;</span> 2024 management</p>
        <p>Crafted with <i class="fas fa-heart footer__icon"></i> by <a href="" target="_blank" class="footer__signature">@Horseman</a></p>
    </footer>
</div>

<script src="https://webapi.amap.com/maps?v=2.0&key=a8ee2821026891a49ecb2e1bc6de087d&plugin=AMap.Scale,AMap.ToolBar"></script>
<script src="https://webapi.amap.com/loca?v=2.0.0&key=a8ee2821026891a49ecb2e1bc6de087d"></script>
<script src="../js/template.js"></script>
<script>
    window.movingDraw = true;
    var map = new AMap.Map('map', {
        zoom: 5,
        showLabel: false,
        viewMode: '3D',
        pitch: 55,
        center: [103.594884, 36.964587],
        mapStyle: 'amap://styles/84ba10a821298afbfc69cac6d854d241',
    });

    var loca = new Loca.Container({
        map,
    });

    loca.ambLight = {
        intensity: 0.7,
        color: '#7b7bff',
    };
    loca.dirLight = {
        intensity: 0.8,
        color: '#fff',
        target: [0, 0, 0],
        position: [0, -1, 1],
    };
    loca.pointLight = {
        color: 'rgb(240,88,25)',
        position: [112.028276, 31.58538, 2000000],
        intensity: 3,
        distance: 5000000,
    };

    var pl = new Loca.PrismLayer({
        zIndex: 10,
        opacity: 1,
        visible: false,
        hasSide: true,
    });

    var geo = new Loca.GeoJSONSource({
        url: 'https://a.amap.com/Loca/static/loca-v2/demos/mock_data/gdp.json',
    });
    pl.setSource(geo);

    pl.setStyle({
        unit: 'meter',
        sideNumber: 4,
        topColor: (index, f) => {
            var n = f.properties['GDP'];
            return n > 7000 ? '#E97091' : '#2852F1';
        },
        sideTopColor: (index, f) => {
            var n = f.properties['GDP'];
            return n > 7000 ? '#E97091' : '#2852F1';
        },
        sideBottomColor: '#002bb9',
        radius: 15000,
        height: (index, f) => {
            var props = f.properties;
            var height = Math.max(100, Math.sqrt(props['GDP']) * 9000 - 50000);
            return height;
        },
        rotation: 360,
        altitude: 0,
    });
    loca.add(pl);
    map.on('complete', function () {
        setTimeout(function () {
            pl.show(500);
            pl.addAnimate({
                key: 'height',
                value: [0, 1],
                duration: 500,
                easing: 'Linear',
                transform: 2000,
                random: true,
                delay: 8000,
            });
            pl.addAnimate({
                key: 'rotation',
                value: [0, 1],
                duration: 500,
                easing: 'Linear',
                transform: 2000,
                random: true,
                delay: 8000,
            });
        }, 800);
    });
    loca.animate.start();

    // 事件处理
    var clickInfo = new AMap.Marker({
        anchor: 'bottom-center',
        position: [116.396923, 39.918203, 0],
    });
    clickInfo.setMap(map);
    clickInfo.hide();
    // 鼠标事件
    map.on('mousemove', function (e) {
        var feat = pl.queryFeature(e.pixel.toArray());
        if (feat) {
            clickInfo.show();
            var props = feat.properties;
            var height = Math.max(100, Math.sqrt(props['GDP']) * 9000 - 50000);
            clickInfo.setPosition([feat.coordinates[0], feat.coordinates[1], height]);
            clickInfo.setContent(
                '<div style="text-align: center; height: 20px; width: 150px; color:#000000; font-size: 16px;">' +
                feat.properties['名称'] + ': ' + feat.properties['GDP'] +
                ' 千件</div>'
            );
        } else {
            clickInfo.hide();
        }
    });
</script>
</body>
</html>